package com.itheima.practice01;

/*

    Scanner中区别用法
    nextLine():结束符为enter
    nextInt():结束符为 tab,空格,enter键
    当在使用 nextInt()时,后面的nextLine()会出现问题,将tab,空格识别为字符作为输入.



 */

import java.util.Scanner;

public class TestDemo04 {

    public static void main(String[] args) {

        Scanner sc=new Scanner(System.in);
/*
        int j=1;
        while(j<=3) {
            System.out.println("请"+j+"次输入:");
            int b = sc.nextInt();
            System.out.println(b);
            j++;
        }*/


        String[] arr=new String[3];
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请"+i+"次输入:");
            arr[i]=sc.nextLine();
        }

        for (String a:arr) {
            System.out.println(a);
        }

    }
}
